win32 printing: Stop using gtk_events_pending
authorMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 00:27:59 +0000 (19:27 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 04:11:49 +0000 (23:11 -0500)
Just use the GMainContext API directly.

gtk/gtkprintoperation-win32.c

index 93036831e8879ac8c224924ac7296ef7a5334f6e..82e604a759af65a2e60384dd76b0bf99fec9b7f0 100644 (file)
@@ -113,13 +113,13 @@ run_mainloop_hook (HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
   if (uiMsg == WM_INITDIALOG)
     {
       gdk_win32_set_modal_dialog_libgtk_only (hdlg);
-      while (gtk_events_pending ())
-       gtk_main_iteration ();
+      while (g_main_context_pending (NULL))
+       g_main_context_iteration (NULL, TRUE);
     }
   else if (uiMsg == got_gdk_events_message)
     {
-      while (gtk_events_pending ())
-       gtk_main_iteration ();
+      while (g_main_context_pending (NULL))
+       g_main_context_iteration (NULL, TRUE);
       return 1;
     }
   return 0;
@@ -1358,13 +1358,13 @@ iprintdialogcallback_handlemessage (IPrintDialogCallback *This,
     {
       gdk_win32_set_modal_dialog_libgtk_only (hDlg);
       callback->set_hwnd = TRUE;
-      while (gtk_events_pending ())
-       gtk_main_iteration ();
+      while (g_main_context_pending (NULL))
+        g_main_context_iteration (NULL, TRUE);
     }
   else if (uMsg == got_gdk_events_message)
     {
-      while (gtk_events_pending ())
-       gtk_main_iteration ();
+      while (g_main_context_pending (NULL))
+        g_main_context_iteration (NULL, TRUE);
       *pResult = TRUE;
       return S_OK;
     }